module.exports = app => {
  const mongoose = require("mongoose")
  mongoose.connect('mongodb://localhost/node-vue-moba',{
    useNewUrlParser: true,
    useUnifiedTopology: true
  })
  
  // 测试是否连接成功
  const conn = mongoose.connection
  conn.on('connected', function(){
    console.log('mongodb启动成功')
  })
}